<template>
	<view class="container">
		<view class="cont">
			<view class="money-box">
				<view class="tit1">请输入会员折扣码</view>
				<view class="v-center w-box">
					<view class="unit">#</view>
					<input :focus="true" confirm-type="done" v-model="num" class="input" @confirm="save"/>
				</view>
				<!-- 	<view class="ts">
					核销码有误，请重新输入
				</view> -->
			</view>
		</view>
		<view class="bottom center" @click="save">
			<view class="center btn">确认</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				num: ''
			};
		},
		methods: {
			save() {
				if (!this.num) return uni.showToast({
					title: '请输入会员折扣码',
					icon: 'none'
				})
				uni.navigateTo({
					url: `/pages/write-off/write-off?code=${this.num}&type=2`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bottom {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100vw;
		height: 130rpx;
		background: #FFFFFF;

		.btn {
			width: 690rpx;
			height: 90rpx;
			background: #005097;
			border-radius: 45rpx;
			font-weight: 800;
			font-size: 30rpx;
			color: #FFFFFF;
		}
	}

	.container {
		width: 100vw;
		min-height: 100vh;
		background: #F5F5F5;
		padding-top: 20rpx;
	}

	.cont {
		padding: 0 24rpx;
	}

	.tit1 {
		font-weight: 500;
		font-size: 28rpx;
		color: #333333;
		padding-left: 25rpx;
	}

	.money-box {
		width: 100%;
		height: 283rpx;
		background: #FFFFFF;
		border-radius: 15rpx;
		padding-top: 37rpx;
		margin-top: 20rpx;
	}

	.w-box {
		width: 648rpx;
		border-bottom: 2rpx solid #E9E9E9;
		padding-bottom: 10rpx;
		margin-top: 26rpx;
		padding-left: 24rpx;

		.unit {
			font-weight: 800;
			font-size: 60rpx;
			color: #999999;
		}

		.input {
			margin-left: 10rpx;
			font-weight: bold;
			font-size: 70rpx;
			color: #333333;
			height: 100rpx;
		}
	}

	.ts {
		padding-left: 24rpx;
		margin-top: 20rpx;
		font-weight: 500;
		font-size: 26rpx;
		color: #FF0000;
	}
</style>